//
//  KABMineTCell.m
//  kabu
//
//  Created by XiangDongMBP on 2017/2/14.
//  Copyright © 2017年 East. All rights reserved.
//

#import "KABMineTCell.h"
#import "UIButton+EdgeInsets.h"

@implementation KABMineTCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.detailBgViewHeightConstraint.constant = 0;
    
    [self.colProBtn addTarget:self action:@selector(colProBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
    [self.colShopBtn addTarget:self action:@selector(colShopBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
    [self.orderBtn addTarget:self action:@selector(orderBtnTapped:) forControlEvents:UIControlEventTouchUpInside];
    
//    [self.colProBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:8.0];
//    [self.colShopBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:8.0];
//    [self.orderBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:8.0];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)colProBtnTapped:(UIButton *)btn {
    if ([self.delegate respondsToSelector:@selector(kABMineTCell:colProBtnTapped:)]) {
        [self.delegate kABMineTCell:self colProBtnTapped:btn];
    }
}

- (void)colShopBtnTapped:(UIButton *)btn {
    if ([self.delegate respondsToSelector:@selector(kABMineTCell:colShopBtnTapped:)]) {
        [self.delegate kABMineTCell:self colShopBtnTapped:btn];
    }
}

- (void)orderBtnTapped:(UIButton *)btn {
    if ([self.delegate respondsToSelector:@selector(kABMineTCell:orderBtnTapped:)]) {
        [self.delegate kABMineTCell:self orderBtnTapped:btn];
    }
}

- (void)setShowDetails:(BOOL)showDetails {
    _showDetails = showDetails;
    self.detailBgViewHeightConstraint.constant = showDetails ? 66 : 0;

    [self.colProBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:8.0];
    [self.colShopBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:8.0];
    [self.orderBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:8.0];
}

@end
